/**
 * 内容组件
 * created by xq on 2018/10/16
 */
import React from 'react'
import PropTypes from 'prop-types'
import Item from './Item'

class Content extends React.Component {
  render() {
    const mapItems = this.props.items.map(v => (v === Number(this.props.searchText) || !this.props.searchText) && (
      <Item item={v} key={v}></Item>
    ))
    return (
      <div>
        {mapItems}
      </div>
    )
  }
}
Content.propTypes = {
  items: PropTypes.array,
  searchText: PropTypes.string
}
export default Content